<#import "/spring.ftl" as spring/>
<tr class="none">
    <td class="tab-cz" onclick="removeFun(this)"><img src="/ls-erp/static/images/del_icon.png" class="delBtn"></td>
    <td class="tab-mfltp"></td>
    <td class="tab-wlup"></td>
    <td class="tab-mflkz"></td>
    <td class="tab-mflcf"></td>
    <td class="tab-mflzsmd"></td>
    <td class="tab-mflfg"></td>
    <td class="tab-jjnf"></td>
    <td class="tab-mflzf"></td>
    <td class="tab-mflsybw">
        <select style="width: 145px ;border:1px solid #acacac" name="" multiple="multiple" >
		<#list itemList as item>
                <option value="${item.itemCode}-${item.itemValue}" >${item.itemName}</option>
		</#list>
        </select>
    </td>
    <td class="tab-mfldh"></td>
    <td class="tabwrite-mfldh" id = "materialUnit"></td>
    <td class="tabwrite-bz" id = "materialRemarks"></td>
    <td style="display:none;"></td>
</tr>
<#list cgMaterialList as cgList>
<#if cgList??&&(cgList?size > 0)>
<tr>
	<td class="tab-cz" onclick="removeFun(this)"><img src="/ls-erp/a/static/images/del_icon.png" class="delBtn"></td>
	<td>
	  <#if cgList.cgMaterialFile?exists&&cgList.cgMaterialFile!=''>
          <p class='tab-mfltp'><img src='${cgList.cgMaterialFile}'></p>
	<#else>
        <p class='tab-mfltp'><img src="/ls-erp/a/static/images/pic-none.jpg"></p>
	</#if>
	</td>
	<td class="tab-wlup"><#if cgList.cgMaterialNameCn??>${cgList.cgMaterialNameCn}</#if><br>${cgList.cgGaterialCd}</td>
	<td class="tab-mflkz"><#if cgList.materialgramWeight??>${cgList.materialgramWeight}</#if></td>
	<td class="tab-mflcf"><#if cgList.cgMaterialComposition??>${cgList.cgMaterialComposition}</#if></td>
	<td class="tab-mflzsmd"><#if cgList.materialThreadCount??>${cgList.materialThreadCount}</#if></td>
	<td class="tab-mflfg">${dict.getDictName(cgList.materialStyle)}</td>
    <td class="tab-jjnf"><#if cgList.cgMaterialColor??>${cgList.cgMaterialColor}</#if></td>
    <td class="tab-mflzf">${dict.getDictName(cgList.materialWeave)}</td>
	<td class="tab-mflsybw">
        <div id="tdTemp${cgList_index}">
        <#if cgList.cgMaterialPlacement??>
             <#list cgList.cgMaterialPlacement?split(",") as placementItems>
             ${dict.getDictName(placementItems)}<br>
             </#list>
        </#if>
        </div>
        <div id="selectTemp${cgList_index}">
        <#if cgList.cgMaterialPlacement??>
        <#assign flg = "0">
        <select style="width: 145px ;border:1px solid #acacac" id="mpt${cgList_index}" name="changeMaterial.cgMatList[${cgList_index}].cgMaterialPlacement" multiple="multiple" >
            <#list itemList as item>
                <#assign flg = "0">
                <#list cgList.cgMaterialPlacement?split(",") as placementItems>
                <#if placementItems== (item.itemCode + "-" + item.itemValue)>
                    <option value="${item.itemCode}-${item.itemValue}" selected="selected">${item.itemName}</option>
                    <#assign flg = "1">
                    <#break>
                </#if>
                </#list>
                <#if flg=='0' >
                    <option value="${item.itemCode}-${item.itemValue}" >${item.itemName}</option>
                </#if>
            </#list>
        </select>
        </#if>
        </div>
	</td>
    <td class="tab-mfldh"><#if cgList.materialQuantity??>${cgList.materialQuantity}</#if></td>
    <td class="tabwrite-mfldh" id = "materialUnit"><#if cgList.materialLoss??>${cgList.materialLoss}</#if></td>
    <td class="tabwrite-bz" id = "materialRemarks"><#if cgList.cgMaterialRemarks??>${cgList.cgMaterialRemarks}</#if></td>
	<td style="display:none;">
        <input type='hidden' class = 'materialRemarks' name='changeMaterial.cgMatList[${cgList_index}].cgMaterialRemarks' value="<#if cgList.cgMaterialRemarks??>${cgList.cgMaterialRemarks}</#if>"/>
        <input type='hidden' class = 'materialUnit' name='changeMaterial.cgMatList[${cgList_index}].materialLoss' value="<#if cgList.materialLoss??>${cgList.materialLoss}</#if>"/>
        <input type='hidden' name='changeMaterial.cgMatList[${cgList_index}].cgMaterialStageCd' value='AUDIT_PHASE_CD-PHASE_CD_10'/>
        <input type='hidden' name='changeMaterial.cgMatList[${cgList_index}].materialUnitPrice' value='<#if cgList.cgMaterialId??>${cgList.materialUnitPrice}</#if>'/>
        <input type='hidden' name='changeMaterial.cgMatList[${cgList_index}].cgMaterialId' value='<#if cgList.cgMaterialId??>${cgList.cgMaterialId}</#if>'/>
	</td>
</tr>
</#if>
</#list>
